@extends('admin.app')

@section('breadcrumb')
  <div class="bg-light lter b-b wrapper-md">
    <ol class="breadcrumb bg-light lter m-n no-padder">
      <li><a href="{{admin_action('HomeController@index')}}">主页</a></li>
      <li><a href="{{admin_action('Web\ArticleCategoriesController@index')}}">文章分类</a></li>
      <li class="active">文章分类信息</li>
    </ol>
  </div>
  @endsection

  @section('content')
    <div class="panel panel-default">
      <div class="panel-heading font-bold">
        文章分类列表
      </div>
      <div class="row wrapper">
        <div class="col-sm-8">
          <form class="form-horizontal" action="{{ admin_action('Web\ArticleCategoriesController@index') }}">
            <div class="row">
              <div class="col-sm-5">
                <div class="form-group">
                  <label class="control-label col-sm-4">分类名称:</label>
                  <div class="col-sm-8">
                    <input type="text" class="form-control" name="article_category_name" value="{{ $article_category_name}}" placeholder="请输入文章分类名称">
                  </div>
                </div>
              </div>
              <div class="col-sm-5">
                <div class="form-group">
                  <label class="control-label col-sm-4">父级分类:</label>
                  <div class="col-sm-8">
                    <input type="text" class="form-control" name="article_category_parent_name" value="{{ $article_category_parent_name}}" placeholder="请输入文章父级分类名称">
                  </div>
                </div>
              </div>
              <div class="col-sm-1 text-left">
                <span class="input-group-btn">
                  <button class="btn btn-sm btn-default" type="submit">查询</button>
                </span>
              </div>
            </div>
          </form>
        </div>
        <div class="col-sm-4 text-right text-center-xs">
          <a class="btn m-b-xs btn-sm btn-default btn-addon" href="{{ admin_action('Web\ArticleCategoriesController@create') }}">
            <i class="fa fa-plus"></i>新增文章分类
          </a>
        </div>
      </div>
      <div class="table-responsive">
        <table class="table table-striped b-t b-light">
          <thead>
            <tr>
              <th>#</th>
              <th>名称</th>
              <th>显示</th>
              <th>推荐</th>
              <th>排序</th>
              <th style="width: 100px">操作</th>
            </tr>
          </thead>
          <tbody>
          @forelse($article_categories as $article_category)
            <tr>
              <td>{{$article_category->id}}</td>
              <td><a href="{{admin_action('Web\ArticleCategoriesController@index',['parent' => $article_category->id])}}"
                     class="text-info-dker">{{$article_category->name}}</a></td>
              <td>{{$article_category->display?'是':'否'}} </td>
              <td>{{$article_category->recommended?'是':'否'}} </td>
              <td>{{$article_category->sort}}</td>
              <td>
                            <a class="btn btn-xs btn-primary"
                               href="{{ admin_action('Web\ArticleCategoriesController@show', [$article_category]) }}"
                               data-toggle="tooltip" title="预览该文章分类">
                                <i class="fa fa-info"></i>
                            </a>
                <a class="btn btn-xs btn-primary" href="{{ admin_action('Web\ArticleCategoriesController@edit',[$article_category]) }}" data-toggle="tooltip" title="编辑信息">
                  <i class="fa fa-pencil"></i>
                </a>
                <form class="inline" action="{{ admin_action('Web\ArticleCategoriesController@destroy',[$article_category]) }}" method="post">
                  {{ csrf_field() }}
                  {{ method_field('DELETE') }}
                  <button type="button" data-swal-role="delete-confirm" class="btn btn-xs btn-danger" data-toggle="tooltip" title="删除信息">
                    <i class="fa fa-trash-o"></i>
                    </button>
                </form>
              </td>

            </tr>
          @empty
            <tr>
              <td colspan="3" class="text-center">没有找到文章分类记录</td>
            </tr>
          @endforelse
          </tbody>
        </table>
      </div>
      <div class="panel-footer">
        <div class="row">
          <div class="col-sm-12 text-right text-center-xs">
            {{ $links }}
          </div>
        </div>
      </div>
    </div>
@endsection
